import java.awt.Canvas;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.Graphics;
import World.World;


public class WorldCanvas extends Canvas {
	private static final long serialVersionUID = 1L;

	Color LiveColor = Color.white;
	Color DeadColor = Color.black;
	Font textFont = new Font("Times New Roman", Font.BOLD, 24);
	Graphics temp = null;
	
	public WorldCanvas(int width, int height)
	{
		//setBackground(Color.black);
		setSize(width, height);

	}
	
	public void paint (Graphics g){
		//g = temp;
		int height = World.environGrid.length; //Main.myWorld.grid.length;
		int width = World.environGrid[0].length;// Main.myWorld.grid[0].length;
		int cellSize = World.cellSize; //Main.myWorld.cellSize;
			for (int i=0; i<height; i++)
			{
				for (int j=0; j<width; j++)
				{
					// Draw environment
					//System.out.println(Main.myWorld.environGrid[i][j].name);
					g.setColor(World.environGrid[i][j].tileColor);//Main.myWorld.environGrid[i][j].tileColor);
					//System.out.println(g.getColor().toString());
					g.fillRect(j*cellSize,i*cellSize,cellSize, cellSize);

				}
			}
	}
}
